using com.byt.suce.db.dao;
using System;
using System.Data;
using System.Data.Common;
using com.byt.webcore;
using System.Collections.Generic;
using MYLSOFT.JsonSimple;
using System.Data.SqlClient;

namespace com.byt.suce.db.mapper {

    public class PkgWorkflow : AbstractDataAccessObject , IPkgWorkflow {

        public PkgWorkflow() {
        }

        public PkgWorkflow.HistoricoGetlistParam historicoGetlist(Connection conn, Dictionary<string, string> map) {
            PkgWorkflow.HistoricoGetlistParam param = newHistoricoGetlistParam(map);
            historicoGetlist(conn, param);
            return param;
        }

        public PkgWorkflow.HistoricoGetlistParam historicoGetlist(Connection conn, JSONObject json) {
            PkgWorkflow.HistoricoGetlistParam param = newHistoricoGetlistParam(json);
            historicoGetlist(conn, param);
            return param;
        }

        public PkgWorkflow.HistoricoGetlistParam historicoGetlist(Connection conn) {
            PkgWorkflow.HistoricoGetlistParam param = newHistoricoGetlistParam();
            historicoGetlist(conn, param);
            return param;
        }

        public void historicoGetlist(Connection conn, PkgWorkflow.HistoricoGetlistParam param) {
            DbCommand cmd = conn.CreateCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "[dbo].WFL_historico_getlist";
            DbParameter par = null;
            // iduser
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@iduser";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Iduser == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Iduser;
            // numeorden
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@numeorden";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 20;
            if (string.IsNullOrEmpty(param.Numeorden))
                par.Value = DBNull.Value;
            else
                par.Value = param.Numeorden;
            // numesuce
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@numesuce";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 20;
            if (string.IsNullOrEmpty(param.Numesuce))
                par.Value = DBNull.Value;
            else
                par.Value = param.Numesuce;
            // numeexpediente
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@numeexpediente";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 20;
            if (string.IsNullOrEmpty(param.Numeexpediente))
                par.Value = DBNull.Value;
            else
                par.Value = param.Numeexpediente;
            // idactividad
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@idactividad";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 20;
            if (string.IsNullOrEmpty(param.Idactividad))
                par.Value = DBNull.Value;
            else
                par.Value = param.Idactividad;
            // estado
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@estado";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 40;
            if (string.IsNullOrEmpty(param.Estado))
                par.Value = DBNull.Value;
            else
                par.Value = param.Estado;
            // evaluador
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@evaluador";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 40;
            if (string.IsNullOrEmpty(param.Evaluador))
                par.Value = DBNull.Value;
            else
                par.Value = param.Evaluador;
            // fechaini
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@fechaini";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.DateTime;
            if (param.Fechaini == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Fechaini;
            // fechafin
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@fechafin";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.DateTime;
            if (param.Fechafin == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Fechafin;
            // page
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@page";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Page == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Page;
            // limit
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@limit";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Limit == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Limit;
            // cur_out
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@cur_out";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Object;
            par.Value = DBNull.Value;
            // totalrows
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@totalrows";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Int32;
            if (param.Totalrows == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Totalrows;
            DataSet ds = new DataSet();
            DataAdapter da = new SqlDataAdapter((SqlCommand)cmd);
            da.Fill(ds);
            param.CurOut = (DbDataReader)ds.Tables[0].CreateDataReader();
            if(DBNull.Value.Equals(cmd.Parameters["@totalrows"].Value))
                param.Totalrows = null;
            else
                param.Totalrows = (int?)cmd.Parameters["@totalrows"].Value;
        }

        public PkgWorkflow.InboxDuplicarParam inboxDuplicar(Connection conn, Dictionary<string, string> map) {
            PkgWorkflow.InboxDuplicarParam param = newInboxDuplicarParam(map);
            inboxDuplicar(conn, param);
            return param;
        }

        public PkgWorkflow.InboxDuplicarParam inboxDuplicar(Connection conn, JSONObject json) {
            PkgWorkflow.InboxDuplicarParam param = newInboxDuplicarParam(json);
            inboxDuplicar(conn, param);
            return param;
        }

        public PkgWorkflow.InboxDuplicarParam inboxDuplicar(Connection conn) {
            PkgWorkflow.InboxDuplicarParam param = newInboxDuplicarParam();
            inboxDuplicar(conn, param);
            return param;
        }

        public void inboxDuplicar(Connection conn, PkgWorkflow.InboxDuplicarParam param) {
            DbCommand cmd = conn.CreateCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "[dbo].WFL_inbox_duplicar";
            DbParameter par = null;
            // idsolicitud
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@idsolicitud";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Idsolicitud == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Idsolicitud;
            // idflujo
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@idflujo";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Int32;
            if (param.Idflujo == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Idflujo;
            // idnewactividad
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@idnewactividad";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 20;
            if (string.IsNullOrEmpty(param.Idnewactividad))
                par.Value = DBNull.Value;
            else
                par.Value = param.Idnewactividad;
            cmd.ExecuteNonQuery();
            if(DBNull.Value.Equals(cmd.Parameters["@idflujo"].Value))
                param.Idflujo = null;
            else
                param.Idflujo = (int?)cmd.Parameters["@idflujo"].Value;
        }

        public PkgWorkflow.InboxGetlistParam inboxGetlist(Connection conn, Dictionary<string, string> map) {
            PkgWorkflow.InboxGetlistParam param = newInboxGetlistParam(map);
            inboxGetlist(conn, param);
            return param;
        }

        public PkgWorkflow.InboxGetlistParam inboxGetlist(Connection conn, JSONObject json) {
            PkgWorkflow.InboxGetlistParam param = newInboxGetlistParam(json);
            inboxGetlist(conn, param);
            return param;
        }

        public PkgWorkflow.InboxGetlistParam inboxGetlist(Connection conn) {
            PkgWorkflow.InboxGetlistParam param = newInboxGetlistParam();
            inboxGetlist(conn, param);
            return param;
        }

        public void inboxGetlist(Connection conn, PkgWorkflow.InboxGetlistParam param) {
            DbCommand cmd = conn.CreateCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "[dbo].WFL_inbox_getlist_Temp";
            DbParameter par = null;
            // iduser
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@iduser";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Iduser == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Iduser;
            // numeorden
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@numeorden";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 20;
            if (string.IsNullOrEmpty(param.Numeorden))
                par.Value = DBNull.Value;
            else
                par.Value = param.Numeorden;
            // numesuce
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@numesuce";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 20;
            if (string.IsNullOrEmpty(param.Numesuce))
                par.Value = DBNull.Value;
            else
                par.Value = param.Numesuce;
            // numeexpediente
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@numeexpediente";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 20;
            if (string.IsNullOrEmpty(param.Numeexpediente))
                par.Value = DBNull.Value;
            else
                par.Value = param.Numeexpediente;
            // idactividad
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@idactividad";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 20;
            if (string.IsNullOrEmpty(param.Idactividad))
                par.Value = DBNull.Value;
            else
                par.Value = param.Idactividad;
            // estado
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@estado";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 40;
            if (string.IsNullOrEmpty(param.Estado))
                par.Value = DBNull.Value;
            else
                par.Value = param.Estado;
            // evaluador
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@evaluador";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 40;
            if (string.IsNullOrEmpty(param.Evaluador))
                par.Value = DBNull.Value;
            else
                par.Value = param.Evaluador;
            // idservicio
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@idservicio";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Idservicio == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Idservicio;
            // fechaini
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@fechaini";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.DateTime;
            if (param.Fechaini == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Fechaini;
            // fechafin
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@fechafin";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.DateTime;
            if (param.Fechafin == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Fechafin;
            // cur_pendientes
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@cur_pendientes";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Object;
            par.Value = DBNull.Value;
            // cur_subsanados
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@cur_subsanados";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Object;
            par.Value = DBNull.Value;
            // cur_escritos
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@cur_escritos";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Object;
            par.Value = DBNull.Value;
            // cur_impagos
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@cur_impagos";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Object;
            par.Value = DBNull.Value;
            // cur_derivados
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@cur_derivados";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Object;
            par.Value = DBNull.Value;
            DataSet ds = new DataSet();
            DataAdapter da = new SqlDataAdapter((SqlCommand)cmd);
            da.Fill(ds);
            param.CurPendientes = (DbDataReader)ds.Tables[0].CreateDataReader();
            param.CurSubsanados = (DbDataReader)ds.Tables[1].CreateDataReader();
            param.CurEscritos = (DbDataReader)ds.Tables[2].CreateDataReader();
            param.CurImpagos = (DbDataReader)ds.Tables[3].CreateDataReader();
            param.CurDerivados = (DbDataReader)ds.Tables[4].CreateDataReader();
        }

        public PkgWorkflow.InboxInsertParam inboxInsert(Connection conn, Dictionary<string, string> map) {
            PkgWorkflow.InboxInsertParam param = newInboxInsertParam(map);
            inboxInsert(conn, param);
            return param;
        }

        public PkgWorkflow.InboxInsertParam inboxInsert(Connection conn, JSONObject json) {
            PkgWorkflow.InboxInsertParam param = newInboxInsertParam(json);
            inboxInsert(conn, param);
            return param;
        }

        public PkgWorkflow.InboxInsertParam inboxInsert(Connection conn) {
            PkgWorkflow.InboxInsertParam param = newInboxInsertParam();
            inboxInsert(conn, param);
            return param;
        }

        public void inboxInsert(Connection conn, PkgWorkflow.InboxInsertParam param) {
            DbCommand cmd = conn.CreateCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "[dbo].WFL_inbox_insert";
            DbParameter par = null;
            // idsolicitud
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@idsolicitud";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Idsolicitud == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Idsolicitud;
            // idflujo
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@idflujo";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Int32;
            if (param.Idflujo == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Idflujo;
            // idversion
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@idversion";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Idversion == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Idversion;
            // idactividad
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@idactividad";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 20;
            if (string.IsNullOrEmpty(param.Idactividad))
                par.Value = DBNull.Value;
            else
                par.Value = param.Idactividad;
            // fechregistro
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@fechregistro";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.DateTime;
            if (param.Fechregistro == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Fechregistro;
            // docnumero
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@docnumero";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 20;
            if (string.IsNullOrEmpty(param.Docnumero))
                par.Value = DBNull.Value;
            else
                par.Value = param.Docnumero;
            // iduseratendio
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@iduseratendio";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Iduseratendio == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Iduseratendio;
            // iduserprop
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@iduserprop";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Iduserprop == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Iduserprop;
            // gestoriddoc
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@gestoriddoc";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Gestoriddoc == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Gestoriddoc;
            // gestoridnotificacion
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@gestoridnotificacion";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Gestoridnotificacion == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Gestoridnotificacion;
            // gestoridcda
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@gestoridcda";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Gestoridcda == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Gestoridcda;
            cmd.ExecuteNonQuery(); //GENERA ERROR SI ES QUE NO SE TIENE UN NUMERO DE EXPEDIENTE RELACIONADO, 
                                   //SE MODIFICO PROCEDURE PARA QUE AGREGUE EL EXPEDIENTE A PARTIR DEL NRO DR //DGS009 
            if(DBNull.Value.Equals(cmd.Parameters["@idflujo"].Value))
                param.Idflujo = null;
            else
                param.Idflujo = (int?)cmd.Parameters["@idflujo"].Value;
        }

        public PkgWorkflow.HistoricoGetlistParam newHistoricoGetlistParam() {
            return new HistoricoGetlistParam();
        }

        public PkgWorkflow.HistoricoGetlistParam newHistoricoGetlistParam(Dictionary<string, string> map) {
            return new HistoricoGetlistParam(map);
        }

        public PkgWorkflow.HistoricoGetlistParam newHistoricoGetlistParam(JSONObject json) {
            return new HistoricoGetlistParam(json);
        }

        public PkgWorkflow.InboxDuplicarParam newInboxDuplicarParam() {
            return new InboxDuplicarParam();
        }

        public PkgWorkflow.InboxDuplicarParam newInboxDuplicarParam(Dictionary<string, string> map) {
            return new InboxDuplicarParam(map);
        }

        public PkgWorkflow.InboxDuplicarParam newInboxDuplicarParam(JSONObject json) {
            return new InboxDuplicarParam(json);
        }

        public PkgWorkflow.InboxGetlistParam newInboxGetlistParam() {
            return new InboxGetlistParam();
        }

        public PkgWorkflow.InboxGetlistParam newInboxGetlistParam(Dictionary<string, string> map) {
            return new InboxGetlistParam(map);
        }

        public PkgWorkflow.InboxGetlistParam newInboxGetlistParam(JSONObject json) {
            return new InboxGetlistParam(json);
        }

        public PkgWorkflow.InboxInsertParam newInboxInsertParam() {
            return new InboxInsertParam();
        }

        public PkgWorkflow.InboxInsertParam newInboxInsertParam(Dictionary<string, string> map) {
            return new InboxInsertParam(map);
        }

        public PkgWorkflow.InboxInsertParam newInboxInsertParam(JSONObject json) {
            return new InboxInsertParam(json);
        }

        public class HistoricoGetlistParam {

            private int? iduser;
            private string numeorden;
            private string numesuce;
            private string numeexpediente;
            private string idactividad;
            private string estado;
            private string evaluador;
            private DateTime? fechaini;
            private DateTime? fechafin;
            private int? page;
            private int? limit;
            private DbDataReader curOut;
            private int? totalrows;

            public HistoricoGetlistParam() {
            }

            public HistoricoGetlistParam(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public HistoricoGetlistParam(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

            public int? Iduser {
                get { return iduser; }
                set { this.iduser = value; }
            }

            public string Numeorden {
                get { return numeorden; }
                set { this.numeorden = value; }
            }

            public string Numesuce {
                get { return numesuce; }
                set { this.numesuce = value; }
            }

            public string Numeexpediente {
                get { return numeexpediente; }
                set { this.numeexpediente = value; }
            }

            public string Idactividad {
                get { return idactividad; }
                set { this.idactividad = value; }
            }

            public string Estado {
                get { return estado; }
                set { this.estado = value; }
            }

            public string Evaluador {
                get { return evaluador; }
                set { this.evaluador = value; }
            }

            public DateTime? Fechaini {
                get { return fechaini; }
                set { this.fechaini = value; }
            }

            public DateTime? Fechafin {
                get { return fechafin; }
                set { this.fechafin = value; }
            }

            public int? Page {
                get { return page; }
                set { this.page = value; }
            }

            public int? Limit {
                get { return limit; }
                set { this.limit = value; }
            }

            public DbDataReader CurOut {
                get { return curOut; }
                set { this.curOut = value; }
            }

            public int? Totalrows {
                get { return totalrows; }
                set { this.totalrows = value; }
            }

            public void setValuesFromMap(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public void setValuesFromMap(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

        }

        public class InboxDuplicarParam {

            private int? idsolicitud;
            private int? idflujo;
            private string idnewactividad;

            public InboxDuplicarParam() {
            }

            public InboxDuplicarParam(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public InboxDuplicarParam(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

            public int? Idsolicitud {
                get { return idsolicitud; }
                set { this.idsolicitud = value; }
            }

            public int? Idflujo {
                get { return idflujo; }
                set { this.idflujo = value; }
            }

            public string Idnewactividad {
                get { return idnewactividad; }
                set { this.idnewactividad = value; }
            }

            public void setValuesFromMap(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public void setValuesFromMap(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

        }

        public class InboxGetlistParam {

            private int? iduser;
            private string numeorden;
            private string numesuce;
            private string numeexpediente;
            private string idactividad;
            private string estado;
            private string evaluador;
            private int? idservicio;
            private DateTime? fechaini;
            private DateTime? fechafin;
            private DbDataReader curPendientes;
            private DbDataReader curSubsanados;
            private DbDataReader curEscritos;
            private DbDataReader curImpagos;
            private DbDataReader curDerivados;

            public InboxGetlistParam() {
            }

            public InboxGetlistParam(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public InboxGetlistParam(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

            public int? Iduser {
                get { return iduser; }
                set { this.iduser = value; }
            }

            public string Numeorden {
                get { return numeorden; }
                set { this.numeorden = value; }
            }

            public string Numesuce {
                get { return numesuce; }
                set { this.numesuce = value; }
            }

            public string Numeexpediente {
                get { return numeexpediente; }
                set { this.numeexpediente = value; }
            }

            public string Idactividad {
                get { return idactividad; }
                set { this.idactividad = value; }
            }

            public string Estado {
                get { return estado; }
                set { this.estado = value; }
            }

            public string Evaluador {
                get { return evaluador; }
                set { this.evaluador = value; }
            }

            public int? Idservicio {
                get { return idservicio; }
                set { this.idservicio = value; }
            }

            public DateTime? Fechaini {
                get { return fechaini; }
                set { this.fechaini = value; }
            }

            public DateTime? Fechafin {
                get { return fechafin; }
                set { this.fechafin = value; }
            }

            public DbDataReader CurPendientes {
                get { return curPendientes; }
                set { this.curPendientes = value; }
            }

            public DbDataReader CurSubsanados {
                get { return curSubsanados; }
                set { this.curSubsanados = value; }
            }

            public DbDataReader CurEscritos {
                get { return curEscritos; }
                set { this.curEscritos = value; }
            }

            public DbDataReader CurImpagos {
                get { return curImpagos; }
                set { this.curImpagos = value; }
            }

            public DbDataReader CurDerivados {
                get { return curDerivados; }
                set { this.curDerivados = value; }
            }

            public void setValuesFromMap(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public void setValuesFromMap(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

        }

        public class InboxInsertParam {

            private int? idsolicitud;
            private int? idflujo;
            private int? idversion;
            private string idactividad;
            private DateTime? fechregistro;
            private string docnumero;
            private int? iduseratendio;
            private int? iduserprop;
            private int? gestoriddoc;
            private int? gestoridnotificacion;
            private int? gestoridcda;

            public InboxInsertParam() {
            }

            public InboxInsertParam(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public InboxInsertParam(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

            public int? Idsolicitud {
                get { return idsolicitud; }
                set { this.idsolicitud = value; }
            }

            public int? Idflujo {
                get { return idflujo; }
                set { this.idflujo = value; }
            }

            public int? Idversion {
                get { return idversion; }
                set { this.idversion = value; }
            }

            public string Idactividad {
                get { return idactividad; }
                set { this.idactividad = value; }
            }

            public DateTime? Fechregistro {
                get { return fechregistro; }
                set { this.fechregistro = value; }
            }

            public string Docnumero {
                get { return docnumero; }
                set { this.docnumero = value; }
            }

            public int? Iduseratendio {
                get { return iduseratendio; }
                set { this.iduseratendio = value; }
            }

            public int? Iduserprop {
                get { return iduserprop; }
                set { this.iduserprop = value; }
            }

            public int? Gestoriddoc {
                get { return gestoriddoc; }
                set { this.gestoriddoc = value; }
            }

            public int? Gestoridnotificacion {
                get { return gestoridnotificacion; }
                set { this.gestoridnotificacion = value; }
            }

            public int? Gestoridcda {
                get { return gestoridcda; }
                set { this.gestoridcda = value; }
            }

            public void setValuesFromMap(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public void setValuesFromMap(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

        }

    }
}
